#include<iostream>
using namespace std;
#include<vector>
#include<list>
class Solution {
public:
    int findWinningPlayer(vector<int>& skills, int k) {
        int n = skills.size(), k1 = k, now = 0;
        for (int i = 1; i < n; ++i) {
            if (skills[now] > skills[i])
                --k1;
            else {
                now = i;
                k1 = k - 1;
            }
            if (k1 == 0)
                return now;
        }
        return now;
    }
};